import request from '@/utils/request'

// 查询菜单列表
export function treeselect(query) {
  return request({
    url: '/TsstAutotestMenu/treeselect',
    method: 'get',
    params: query
  })
}

// 查询菜单列表
export function selectTsstAutoTestMenuList(query) {
  return request({
    url: '/TsstAutotestMenu/list',
    method: 'get',
    params: query
  })
}

// 新增菜单信息
export function addAtMenu(data) {
  return request({
    url: '/TsstAutotestMenu/insert',
    method: 'post',
    data: data
  })
}

// 修改菜单信息
export function updateAtMenu(data) {
  return request({
    url: '/TsstAutotestMenu/update',
    method: 'post',
    data: data
  })
}

// 修改菜单信息
export function deleteAtMenu(query) {
  return request({
    url: '/TsstAutotestMenu/delete',
    method: 'get',
    params: query
  })
}

// 查询菜单接口列表
export function getMenuDetail(query) {
  return request({
    url: '/tsstAutotestItem/getMenuDetail.action',
    method: 'get',
    params: query
  })
}

// 新增菜单和接口的对应关系
export function saveAutoTestItem(data) {
  return request({
    url: '/tsstAutotestItem/saveAutoTestItem.action',
    method: 'post',
    data: data
  })
}

//运行自动化测试
export function autoTestRun(data) {
  return request({
    url: '/TsstAutotestMenu/autoTestRun.action',
    method: 'post',
    data: data
  })
}

//查询自动测试报告
export function queryAtReport(query) {
  return request({
    url: '/infReport/queryAutoReportList',
    method: 'get',
    params: query
  })
}

//删除自动测试报告
export function deleteReports(data) {
  return request({
    url: '/infReport/deleteReport',
    method: 'post',
    data: data
  })
}

//停止自动化测试
export function stopRunTask(data) {
  return request({
    url: '/TsstAutotestMenu/stopRunTask.action/' + data,
    method: 'get'
  })
}

//定时获取测试过程
export function queryInfResultTimer(data) {
  return request({
    url: '/TsstAutotestMenu/queryInfResultTimer/' + data,
    method: 'get'
  })
}

//后台停止记录计算结果
export function stopRecord(data) {
  return request({
    url: '/TsstAutotestMenu/stopRecordInfresult/' + data,
    method: 'get'
  })
}